/**
 * 
 */
package cz.cvut.fit.crhonjar.mi.paa.thames.solver;

import java.util.List;

import cz.cvut.fit.crhonjar.mi.paa.thames.Item;

/**
 * @author Jarec
 * 
 */
public class FPTASSolver extends DynamicProgrammingSolver {

	private int ignoredBits = 2;

	/**
	 * @return the ignoredBits
	 */
	public int getIgnoredBits() {
		return this.ignoredBits;
	}

	@Override
	public void initiate(final List<Item> items, final Integer bagCapacity) {
		final int bagCapacityRounded = (bagCapacity) >> this.ignoredBits;
		super.initiate(items, bagCapacityRounded);
		for (final Item item : this.items) {
			item.roundWeightBits(this.ignoredBits);
		}

	}

	/**
	 * @param ignoredBits
	 *            the ignoredBits to set
	 */
	public void setIgnoredBits(final int ignoredBits) {
		this.ignoredBits = ignoredBits;
	}

}
